package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;
	import flash.net.Socket;

	public class SpykePaintProxy extends SpykeWidgetProxy implements SpykePaint
	{

		public function SpykePaintProxy(remoteeID:int, connection:RemedyClientServerConnection)
		{
			super(remoteeID, connection);
		}

		public function registerListener(a:SpykePaintListener):void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 43);
				RemedyMOClassManager.INSTANCE.writeWithGraph(a, connection, new Vector.<Object>());

			});
		}

		public function getPaintSettings(onReturn:Function/*PaintSettings*/):void
		{
			connection.performCall(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 41);

			}, new RemedyFunctionSpecification(onReturn, RemedyDOClassManager.INSTANCE));
		}

		public function drawNewLine(a:int, b:int, c:int, d:int):void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 42);
				RemedyIntegerClassManager.INSTANCE.writeWithGraph(a, connection, new Vector.<Object>());
				RemedyIntegerClassManager.INSTANCE.writeWithGraph(b, connection, new Vector.<Object>());
				RemedyIntegerClassManager.INSTANCE.writeWithGraph(c, connection, new Vector.<Object>());
				RemedyIntegerClassManager.INSTANCE.writeWithGraph(d, connection, new Vector.<Object>());

			});
		}

		public function resetPaint(a:PaintSettings):void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 44);
				RemedyDOClassManager.INSTANCE.writeWithGraph(a, connection, new Vector.<Object>());

			});
		}
	}
}
